﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Drawing;
using WebChart;

using PowerCreator.LMS.Common.Script;

public partial class sysadmin_CountManager_ProjectPassCount : PowerCreator.LMS.Web.Base.BasePage
{
    //ManagerProjectHistoryInfo objProjectHistoryLogic = new ManagerProjectHistoryInfo();
    //ManagerProjectInfo projectManager = new ManagerProjectInfo();
    protected void Page_Load(object sender, EventArgs e)
    {
        //if (!Page.IsPostBack)
        //{
        //    ViewState["ProjectID"] = Base64.Decode(Request.QueryString["p"].ToString());           
        //    BandChart(int.Parse(ViewState["ProjectID"].ToString()));
        //}
    }

    private void BandChart(int projectID)
    {
        //ProjectInfo pinfo = new ProjectInfo();
        //pinfo = projectManager.Load(projectID);
        //DataTable dt = new DataTable();
        //string search = " and ProjectID=" + projectID.ToString();
        //dt = objProjectHistoryLogic.GetProjectPassCount(search);
        //int PassCount = int.Parse(dt.Rows[0]["CountEnd"].ToString());
        //int UserSumCount = int.Parse(dt.Rows[0]["Usercount"].ToString());
        //int BeginCount = int.Parse(dt.Rows[0]["CountBegin"].ToString());
        //int UnBeginCount = UserSumCount - PassCount - BeginCount;

        //lab_EndCount.Text = "完成人数：" + PassCount.ToString();
        //lab_UnBegin.Text = "未开始人数：" + UnBeginCount.ToString();
        //lab_BeginCount.Text = "进行中人数："+BeginCount.ToString();


        //lab_UserCount.Text = UserSumCount.ToString();

        //ChartPointCollection data = new ChartPointCollection();

        //data.Add(new ChartPoint("Ene", BeginCount));
        //data.Add(new ChartPoint("Feb", UnBeginCount));
        //data.Add(new ChartPoint("Ene", PassCount));


        //PieChart c = new PieChart(data, Color.Brown);
        //c.Colors = new Color[] { Color.Red, Color.Blue,Color.Green };
        //chart1.ChartTitle.Text = pinfo.ProjectName + "完成率";
        //chart1.Charts.Add(c);
        //chart1.RedrawChart();

    }
    protected void btnPrinter_Click(object sender, EventArgs e)
    {
        Script.RedirectURL("ProjectInfo.aspx");
    }
}
